package get;

import java.io.IOException;
import java.util.HashSet;
import java.util.ListIterator;

import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import stats.CountElements;


public class JGet {
//	static Document doc = null;
//	static Elements elements = new Elements();
	static CountElements ce = new CountElements();
	public static void main (String args[]) throws IOException {
		String url = "http://www.eelly.com/goods-3067196.html";

		System.out.println(ce.CountGoodsViewPics(url));
	}
		

}

class Nodes {
	HashSet<String> hs = new HashSet<String>();
	static ListIterator<Element> eleList;
	
	String[] getElementTypes (Elements elements) {
		String[] elTypes = new String[GetUniqNodeCounts(elements)];
		int x = 0;
		for (String s : GetUniqNodeNames(elements)) {
			elTypes[x] = s;
			x++;
		}
		return elTypes;
	}
	
	HashSet<String> GetUniqNodeNames (Elements elements) {
		eleList = elements.listIterator();
		while (eleList.hasNext()) {
			hs.add(eleList.next().nodeName());
		}
		return hs;
	}
	
	int GetUniqNodeCounts (Elements elements) {
		eleList = elements.listIterator();
		while (eleList.hasNext()) {
			hs.add(eleList.next().nodeName());
		}
		return hs.size();
	}
}